<template>
	<view>
		<!-- <view class="international">
			<view v-for="(item,index) in listitem" :key="index" class="item" @click="onSelect(item)">
				<view class="">
					<text>{{item.en}}</text>
					<text>({{item.cn}})</text>
				</view>
				<text>{{item.code}}</text>
			</view>
		</view> -->
		<uni-indexed-list :options="listitem" :showSelect="false" @click="onSelect"></uni-indexed-list>

	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import indexList from '@/util/country.js'
	import code from '@/util/code.js'
	const listitem = ref([])
	console.log(code)
	listitem.value = code.list
	const onSelect = (item) => {
		console.log(item.item)
		uni.$emit("onSelectAreaCode", item.item.name.code)
		uni.navigateBack()
	}
</script>

<style lang="scss">
	page {
		background: #F6F7F9;
		
	}
	.international {
		
		background: #fff;
		padding: 38rpx;
		margin: 38rpx;
		border-radius: 23rpx;
		.item {
			height: 120rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			width: 100%;
			border-bottom: 1rpx solid #F6F6F6;
		}

	}
</style>